#ifndef FENETRE_H
#define FENETRE_H

#include "Application.h"
#include <QWidget>
#include <QGroupBox>
#include <QLabel>
#include <QPushButton>
#include <QTextEdit>
#include <QBoxLayout>
#include <QImage>
#include <QtMultimedia\QSound>
#include <QTime>
#include <QTimer>
#include<QKeyEvent>

using namespace std;

class Fenetre : public QWidget
{
	Q_OBJECT

public :
	Fenetre();

private slots :
    void lumiere();
	void musique();
	void affichage();
	void temperatureGestion();
	void chronometre();
	void okFPGA();
	void problemeFPGA(string msg);

private :
	Application* app;

	void keyPressEvent(QKeyEvent *e);

	void loadImages();
	void loadMusique();
	void setConsole();
	void setTemperature();
	void setBoutons();
	void setEtats();
	void setChronometre();
	void setLayoutPrincipal();
	int getTemperature();

	QImage *imgLumiereAllumee;
	QImage *imgLumiereEteinte;
	QImage *imgMusiqueLecture;
	QImage *imgMusiqueStop;
	QImage *imgAffichageCamera;
	QImage *imgAffichageTemperature;
	QSound *sndMusique;
	
	QGroupBox *boxAffichage;
	QGroupBox *boxEtats;
	QGroupBox *boxBoutons;
	QGroupBox *boxFPGA;
	QHBoxLayout *lytAffichage;
	QLabel *lblLumiere;
	QLabel *lblMusique;
	QLabel *lblAffichage;
	QLabel *lblFPGA;
	QPushButton *btnLumiere;
	QPushButton *btnMusique;
	QPushButton *btnAffichage;

	QTextEdit *txtZoneTexte;
	QTextEdit *txtTempTexte;
	QLabel *chrono;
	QTimer *timer;
	QTimer *timerTemperature;
	QTime temps;
};

#endif // FENETRE_H